<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function Person(name,age){
            this.name = name ; 
            this.age = age ; 
            Person.num = 0 ;
            Person.num = this.fn();
        }
        Person.prototype.fn = function (){
            Person.num ++ ;  
            return Person.num ; 
        }
        let zhangsan = new Person("张三",20);
        let lisi = new Person("李四",22);
        let lisi2 = new Person("李四",22);
        let lisi3 = new Person("李四",22);
        let lisi4 = new Person("李四",22);
        let lisi5 = new Person("李四",22);
        console.log(Person.num);
    </script>
</body>
</html>